// Miniworld friend monitor link changer.
// Version 0.1 BETA!
// 2007-12-06
// Copyright (c) 2007, Scott Yu
// Released under the GPL license
// http://scottyu.miniworld.com.tw/
//
// ==UserScript==
// @name          Friend monitor link target changer
// @namespace     http://scottyu.miniworld.com.tw/
// @description   Change Miniworld friend monitor link target to new window.
// @include       http://www.miniworld.com.tw/cp.php?op=myFriends*
// ==/UserScript==

var links, a, href;
links = document.evaluate(
    "//a[@href]",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < links.snapshotLength; i++) {
    a = links.snapshotItem(i);
    href = a.href;
    
    if (href.match(/javascript:parent\.parent\.location=('[^']+')/i)) {
		href = "javascript:window.open($1)";
    }
    
    if (href != a.href) {
	a.href = href;
	a.onclick = null;
    }
}

// ChangeLog
// 2007-12-06 - 0.1 - The first version.
//
